﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Utils.Extention;
#region Version Info
/* ========================================================================
* 【本页面功能概述】
*
* 作者：wangjianfeng 创建时间：2012/9/16 14:43:00
* 文件名：WebLinks.cs
*
* 修改者： 时间：
* 修改说明：
* ========================================================================
*/
#endregion
namespace ChinaLeg.Web.Lib
{
    public class WebLinks
    {
        public static string WebUrl
        {
            get {
                return ConfigSingleton.Instance.Url;
            }
        }
        
        public static string GetNewsLinks(object id)
        {
            return string.Format("{1}/news/news{0}.html", id.ToTrim(),WebUrl);
        }

        public static string GetCaseLink(object id)
        {
            return string.Format("{1}/news/case{0}.html", id.ToTrim(), WebUrl);
        }

        public static string GetCasePictrue(object id)
        {
            return string.Format("{1}/news/pictrue{0}.html", id.ToTrim(), WebUrl);
        }

        public static string GetCatLinks(object id)
        {
            //return string.Format("/category/{0}.html",id.ToTrim());
            string url = "";
            switch (id.ToInt32())
            {
                case 2:
                    url = "/hotattention.html";
                    break;
                case 3:
                    url = "/category/OLeg.html";
                    break;
                case 4:
                    url = "/category/XLeg.html";
                    break;
                case 5:
                    url = "/category/BLeg.html";
                    break;
                case 6:
                    url = "/category/ZLeg.html";
                    break;
                case 7:
                    url = "/category/SLeg.html";
                    break;
                case 8:
                    url = "/category/DLeg.html";
                    break;
                case 9:
                    url = "/category/TLeg.html";
                    break;
                case 10:
                    url = "/category/RepairLeg.aspx";
                    break;
                case 11:
                    url = "/case.html";
                    break;
                case 12:
                    url = "/ask.html";
                    break;
                case 13:
                    url = "/ExpertTeam.html";
                    break;

            }
            return WebUrl+url;
        }

        public static string GetListLinks(object id)
        {
            return string.Format("{1}/list/list{0}.html", id.ToTrim(), WebUrl);
        }

        public static string GetListLinks(object id,int type)
        {
            return string.Format("{1}/list/list{0}-{1}.html", id.ToTrim(), type, WebUrl);
        }

        public static string GetCaseCatLinks(object id)
        {
            return string.Format("{1}/list/case{0}.html", id.ToTrim(), WebUrl);
        }
    }
}